/**
 * 核验相关类型定义
 * 创建时间：2025-09-11
 * 作者：开发团队
 * 目的：定义核验模块数据类型
 */

import type { VerificationResult, SpecialVisitorType } from './common'

// 访客信息接口
export interface VisitorInfo {
  id: number
  name: string
  phone: string
  id_card?: string
  company?: string
  visit_time: string
  purpose: string
  host_name: string
  host_phone: string
  created_at: string
  expires_at: string
  is_special: boolean
  special_type?: SpecialVisitorType
}

// 二维码核验请求
export interface QrCodeVerificationRequest {
  qr_data: string
  guard_id: number
}

// 二维码核验响应
export interface QrCodeVerificationResponse {
  result: 'valid' | 'invalid' | 'expired' | 'blacklist'
  visitor_info: VisitorInfo
}

// 核验结果提交请求
export interface VerificationSubmitRequest {
  qr_data: string
  guard_id: number
  result: VerificationResult
  notes?: string
}

// 核验记录接口
export interface VerificationRecord {
  id: number
  visitor_name: string
  visitor_phone: string
  visitor_id_card?: string
  company?: string
  host_name: string
  host_phone: string
  visit_time: string
  purpose: string
  verification_time: string
  guard_id: number
  guard_name: string
  result: VerificationResult
  rejection_reason?: string
  is_special: boolean
  special_type?: SpecialVisitorType
  created_at: string
  notes?: string
}

// 核验记录查询参数
export interface VerificationRecordsParams {
  start_date?: string
  end_date?: string
  result?: VerificationResult
  search?: string
  page?: number
  size?: number
  campus_id?: number
  guard_id?: number
}

// 今日统计数据
export interface TodayStatistics {
  total_verifications: number
  pass_count: number
  reject_count: number
  special_visitor_count: number
  my_verifications: number
}